# 版本
cmake_minimum_required(VERSION 3.0)
# 项目名
project(CloudDisk)
# c++标准
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED on)

# 递归搜索所有 .cc 文件
file(GLOB_RECURSE CLOUDDISK_SOURCES 
    "./srcCloudDisk/*.cc")

# 添加可执行文件 - 先定义 cloudDisk 目标
add_executable(cloudDisk ${CLOUDDISK_SOURCES})

# 为 cloudDisk 目标添加头文件搜索路径
target_include_directories(cloudDisk PRIVATE ./include)

# 为 cloudDisk 目标添加编译选项
target_compile_options(cloudDisk PRIVATE 
-g -Wall -fno-rtti -DBUG)

# 为 cloudDisk 可执行文件单独设置输出路径（可选）
set_target_properties(cloudDisk PROPERTIES
    RUNTIME_OUTPUT_DIRECTORY
    ../)

# 添加连接库
target_link_libraries(cloudDisk PRIVATE 
wfrest alibabacloud-oss-cpp-sdk curl crypto pthread workflow ssl jwt log4cpp SimpleAmqpClient)

# 递归搜索所有 .cc 文件
file(GLOB_RECURSE BACKUP_SOURCES 
    "./srcMqBackup/*.cc"
    "./srcCloudDisk/MessageQueue.cc"
    "./srcCloudDisk/Logger.cc"
    "./srcCloudDisk/OssManger.cc")

# 添加可执行文件 - 再定义 backup 目标
add_executable(backup ${BACKUP_SOURCES})

# 为 backup 目标添加头文件搜索路径
target_include_directories(backup PRIVATE ./include)

# 为 backup 目标添加编译选项
target_compile_options(backup PRIVATE 
-g -Wall -fno-rtti -DBUG)

# 为 backup 可执行文件单独设置输出路径（可选）
set_target_properties(backup PROPERTIES
    RUNTIME_OUTPUT_DIRECTORY
    ../)

# 添加连接库
target_link_libraries(backup PRIVATE 
wfrest alibabacloud-oss-cpp-sdk curl crypto pthread workflow ssl jwt log4cpp SimpleAmqpClient)